/*
 * i2c_slave.h
 *
 *  Created on: Jan 11, 2014
 *      Author: bohni
 */

#ifndef I2C_SLAVE_H_
#define I2C_SLAVE_H_

#include <avr/io.h>
#include <stdint.h>
#include <util/twi.h>
#include <avr/interrupt.h>

#include "c_g_module_config.h"

/////////////////////////////////////////////////////
#ifndef I2C_FREQ
#define I2C_FREQ			400000
#endif

#ifndef I2C_SLAVE_ADR
#define I2C_SLAVE_ADR  		0x38
#endif

#define I2C_BUFFER_SIZE 	32

extern volatile uint8_t i2c_buffer[I2C_BUFFER_SIZE];
extern volatile uint8_t i2c_buf_ptr;
extern volatile uint8_t i2c_busy;
extern volatile uint8_t i2c_state;

void i2c_slave_init( void );




#endif /* I2C_SLAVE_H_ */
